load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "migrations",
    srcs = ["migrations.go"],
    embedsrcs = ["sqlmigrations/0001_init.sql"],
    importpath = "github.com/cockroachdb/cockroach/pkg/obsservice/obslib/migrations",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/util/log",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_jackc_pgx_v5//:pgx",
        "@com_github_jackc_pgx_v5//stdlib",
        "@com_github_pressly_goose_v3//:goose",
    ],
)

go_test(
    name = "migrations_test",
    srcs = ["migrations_test.go"],
    embed = [":migrations"],
    deps = [
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "@com_github_stretchr_testify//require",
    ],
)
